﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>管理员操作</title>
    <link href="~/plugins/layui/css/layui.css" rel="stylesheet" />
</head>
<body style="margin-left:10px;margin-top:10px;">
    @using (Html.BeginForm("glyau", "ljsheng", new { gid = Request.QueryString["gid"] }, FormMethod.Post, new { @class = "layui-form-pane layui-form", enctype = "multipart/form-data" }))
    {
        <div class="layui-form-item layui-hide">
            <label class="layui-form-label">请选择省市区</label>
            <div class="layui-input-inline">
                <select name="province" id="Province" lay-ignore>
                    <option></option>
                </select>
            </div>
            <div class="layui-input-inline">
                <select name="city" id="City" lay-ignore>
                    <option></option>
                </select>
            </div>
            <div class="layui-input-inline">
                <select name="area" id="Area" lay-ignore>
                    <option></option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-inline">
                <input type="text" name="account" lay-verify="account" placeholder="请输入" autocomplete="off" class="layui-input" value="@ViewBag.account" @(string.IsNullOrEmpty(Request.QueryString["gid"]) ? "" : "disabled=\"\"")>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密码</label>
            <div class="layui-input-inline">
                <input type="password" name="pwd" lay-verify="pass" placeholder="请输入密码" autocomplete="off" class="layui-input" value="@ViewBag.pwd">
            </div>
            <div class="layui-form-mid layui-word-aux">密码6-20位</div>
        </div>
        <div class="layui-form-item layui-hide">
            <label class="layui-form-label">余额</label>
            <div class="layui-input-inline">
                <input type="text" name="rmb" lay-verify="num" autocomplete="off" class="layui-input" onkeyup="value=value.replace(/[^\d.]/g,'');" value="0">
            </div>
            <div class="layui-form-mid layui-word-aux">账户余额</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">别名</label>
            <div class="layui-input-inline">
                <input type="text" name="real_name" placeholder="请输入" autocomplete="off" class="layui-input" value="@ViewBag.real_name">
            </div>
            <div class="layui-form-mid layui-word-aux">公告=对应滚动文本/普通=对应普通链接/高级=对应高级链接/说明=对应使用说明链接</div>
        </div>
        <div class="layui-form-item layui-hide">
            <label class="layui-form-label">折扣</label>
            <div class="layui-input-inline">
                <input type="text" name="zk" lay-verify="num" autocomplete="off" class="layui-input" onkeyup="value=value.replace(/[^\d.]/g,'');" value="0">
            </div>
            <div class="layui-form-mid layui-word-aux">1为套餐原价,0.01就是套餐售价得百分之一以此类推</div>
        </div>
        <div class="layui-form-item" pane="">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-block">
                <input type="radio" name="sex" value="男" title="男" @(ViewBag.sex != 2 ? "checked=\"\"" : "")>
                <input type="radio" name="sex" value="女" title="女" @(ViewBag.sex == 2 ? "checked=\"\"" : "")>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">用户备注</label>
            <div class="layui-input-block">
                <textarea type="text" id="explain" name="explain" autocomplete="off" class="layui-textarea">@ViewBag.explain</textarea>
            </div>
        </div>
        <div class="layui-form-item" pane="">
            <label class="layui-form-label">用户状态</label>
            <div class="layui-input-block">
                <input type="radio" name="qx" value="管理员" title="管理员" checked="checked">
            </div>
        </div>
        <div class="layui-form-item">
            <button class="layui-btn" lay-submit="">提交</button>
            <div class="layui-form-mid layui-word-aux" style="color:#FF5722;">@ViewBag.msg</div>
        </div>
    }
    <script src="~/js/pca.js" charset="gb2312"></script>
    <script src="~/plugins/layui/layui.js"></script>
    <script>
        setup();
        if ("@ViewBag.province".length > 0) {
            preselect("@ViewBag.province");
            document.getElementById("City").value = "@ViewBag.city";
            change(2);
            document.getElementById("Area").value = "@ViewBag.area";
        }

        layui.use(['form'], function () {
            var form = layui.form();

            //自定义验证规则
            form.verify({
                account: function (value) {
                    if (value.length < 3) {
                        return '用户名至少得3个字符啊';
                    }
                }
                , pass: [/(.+){6,20}$/, '密码必须6到20位']
            });
        });
    </script>
</body>
</html>
